﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Paises.aspx.vb" Inherits="Hosteria_VS_Paises" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
        Mantenimiento de Paises</p>
    <p>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Code" 
            DataSourceID="sdaPais" EmptyDataText="No hay registros de datos para mostrar.">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="Code" HeaderText="Código" ReadOnly="True" 
                    SortExpression="Code" />
                <asp:BoundField DataField="Nombre" HeaderText="Nombre" 
                    SortExpression="Nombre" />
            </Columns>
        </asp:GridView>
        <asp:LinkButton ID="lbAgregar" runat="server">Agregar</asp:LinkButton>
        <asp:TextBox ID="txtCode" runat="server"></asp:TextBox>
        <asp:TextBox ID="txtNombre" runat="server"></asp:TextBox>
        <asp:SqlDataSource ID="sdaPais" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TESTConnectionString %>" 
            DeleteCommand="DELETE FROM [Pais] WHERE [Code] = @Code" 
            InsertCommand="INSERT INTO [Pais] ([Code], [Nombre]) VALUES (@Code, @Nombre)" 
            ProviderName="<%$ ConnectionStrings:TESTConnectionString.ProviderName %>" 
            SelectCommand="SELECT [Code], [Nombre] FROM [Pais]" 
            UpdateCommand="UPDATE [Pais] SET [Nombre] = @Nombre WHERE [Code] = @Code">
            <DeleteParameters>
                <asp:Parameter Name="Code" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="Code" Type="Int32" />
                <asp:Parameter Name="Nombre" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="Nombre" Type="String" />
                <asp:Parameter Name="Code" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
</asp:Content>

